#ifndef SAMPLE_H
#define SAMPLE_H
#include <cstdint>

#pragma pack(1)
class sample final
{
public:
    sample();

    uint32_t getRgb() const;
    void setRgb(uint32_t newRgb);

    uint32_t getBed() const;
    uint32_t getKitchen() const;

    double getLongitude() const;
    void setLongitude(double newLongitude);

    void print() const;
private:
    uint8_t age;
    uint8_t _1;
    uint8_t minute;
    int16_t height;
    uint16_t weight;
    union
    {
        uint32_t val;
        struct
        {
            uint32_t bed:1;
            uint32_t :9;
            uint32_t kitchen:1;
            uint32_t :1;
            uint32_t rgb:3;
        };
    } state;
    int32_t longitude;
};
#pragma pack()


#endif // SAMPLE_H
